package done.normal_1001_1100;

import org.junit.Test;

import static com.study.util.LogUtil.info;

/**
 * 1079. Letter Tile Possibilities 活字印刷
 * <p>
 * 你有一套活字字模 tiles，其中每个字模上都刻有一个字母 tiles[i]。返回你可以印出的非空字母序列的数目。
 * <p>
 * 示例 1：
 * 输入："AAB"
 * 输出：8
 * 解释：可能的序列为 "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA"。
 * <p>
 * 示例 2：
 * 输入："AAABBC"
 * 输出：188
 *
 * @author wangxiaozhe
 */
@SuppressWarnings("all")
public class LetterTilePossibilities {

    public int numTilePossibilities(String tiles) {
        // 190617 first
        return -1;
    }

    @Test
    public void test() {
        info(numTilePossibilities("AAABBC"));
    }
}



























/*
public int numTilePossibilities(String tiles) {
    Integer[] nums = new Integer[tiles.length()];
    for (int k = 0; k < tiles.length(); k++) {
        nums[k] = tiles.charAt(k) - '0';
    }

    int res = 0;
    res += dfs("", Arrays.asList(nums), new HashSet<String>());
    return res;
}

private int dfs(String word, List<Integer> list, HashSet<String> set) {
    int res = 0;
    if (word.length() != 0 && !set.contains(word)) {
        set.add(word);
        res++;
    }

    for (int i = 0; i < list.size(); i++) {
        List<Integer> tList = new LinkedList<Integer>(list);
        int tmp = (int) tList.remove(i);
        res += dfs(word + tmp, tList, set);
    }
    return res;
}
*/